package model;

import java.util.List;

import javax.persistence.Query;

public class DAOProfessor extends DAOJPA<Professor>{
	
	public List<Turma> findTurmas(Professor p){
		String login = p.getLogin();
		Query qr = getManager().createQuery("select t from Professor p join p.turmas t where p.login=?");
		qr.setParameter(1, login);
		List<Turma> resultList = qr.getResultList();
		return resultList;
	}
}
